1. Field of the Invention
The present invention concerns a system for maintaining versions of software source code. More specifically, the present invention provides a system for use by software developers during the development and maintenance of the software source code of a software system, whereby modified versions of the software source code are tracked and stored on a line-by-line basis within a source code storage. Because modified versions of the software source code are tracked and stored on a line-by-line basis, it is possible for multiple software developers to work on the same software source code at the same time, while still providing historical version tracking of all modifications to each of the source code lines.
2. Description of the Related Art
Development of a software system typically involves the authoring of a large number of lines of software source code which are typically arranged into one or more files wherein each file contains several source code lines. The source code files are compiled or translated from the programming language in which they were written into machine-language objects which are then linked together to form a cohesive executable program for execution on a computer.
Typically, the source code files that comprise a software system are stored within the memory of one or more computers or file servers during the development, maintenance and upgrade of the software system. Software developers using workstations in a networked environment edit the source code as needed during development to implement the objectives and design requirements for the software system, to fix errors (xe2x80x9cbugsxe2x80x9d), and to make upgrades or enhancements. The edited source code files are then used to re-build the software system, thereby incorporating the changes and modifications made by the software developers. Tracking of both edited and non-edited source code is therefore desirable in order to ensure that all changes and modifications are eventually completed, and to ensure that changes can be backed out if they introduce errors.
The tracking of software source code becomes much more critical during development of a large-scale, complex software system by multiple software developers in a distributed software development system comprising numerous computing devices within a network environment. Currently, several types of software management tools are available to assist software developers during the development of software systems. Computer-Aided Software Engineering (CASE) tools are typically used in large-scale, complex software system development projects to provide configuration management and version control of the software source code that comprises the software system. Examples of current CASE tools that provide version control include, among others, Revision Control System (RCS) and Source Code Control System (SCCS) for use in UNIX-based computing environments, and Program Version Control System (PVCS) and Microsoft""s SourceSafe(trademark) for use in DOS- or Windows-based computer environments.
The typical prior art version control tool, such as those mentioned above, generally provides the ability to track the versions of software source code from its inception to its current state, including all versions in between. A new version of the source code is generally created after a set of modifications and/or additions have been made to the previously existing source code files. Known version control tools generally maintain and track modifications to software source code by establishing and tracking multiple versions of the individual software files that comprise the software source code during the development process.
Version control according to these known tools generally consists of four major functions. First, a software system library is maintained for storing a master copy of all software source code files that comprise the software system. Second, access to the individual source code files is controlled by allowing each particular source code file to be checked-out to only one software developer at a time for modifications, thereby providing a local copy of the source code file to the software developer""s workstation for editing as needed. While the source code file is checked-out to one of the software developers, other software developers are locked-out and prevented from making any changes to the source code file, although they are able to read the unedited master copy of the source code file from the software system library. This lock-out mechanism prevents subsequent problems that would arise during check-in of the source code file if more than one software developer had made changes to the same source code file at the same time. Third, modifications are introduced to the master copy of the source code file from the local copy of the source code file that was edited by the software developer who checked-out the source code file. Fourth, version tracking of each of the source code files is maintained pursuant to one of two methods. In the first method, an entire copy of the modified source code file is saved to the master copy in the library and is given a new version number. In the second method, only the modifications that were made from the prior master copy are saved, such that only those modifications that were made by the software developer to the checked-out source code file are saved in the software system library, along with a corresponding new version number. In this method, a particular version of a source code file is subsequently obtained by accessing the original master copy and then applying all of the changes corresponding to each version of the source code file that was created since the original master copy.
Although the known version control tools for file-based source code provide the capability for historical version tracking of modifications made to each source code file, several drawbacks and adverse consequences arise when developing a software system using such version control tools in a multiple software developer environment. First, the memory storage space that is needed to store multiple complete versions for each source code file grows unmanageably large when developing a large, complex software system in a multiple software developer environment.
Second, the lock-out mechanism utilized by traditional version control tools operates on a file-by-file basis, thereby preventing other software developers from working on a source code file that has been checked out, even though a single source code file may contain several routines, functions, and source code lines that are not being modified by the software developer who checked-out the source code file. Thus, all other software developers that have unrelated changes to make within the checked-out file must wait until the source code file is checked-in before proceeding to make their changes to the source code file. Development of a source code file under traditional version control is therefore performed in a sequential rather than concurrent manner, thereby resulting in the introduction of significant delays into the development process. In addition, since all other software developers have read-only access to the unedited master copy of the source code file while it is checked out, they cannot access the modifications that were incorporated in the checked-out source code file in order to determine if the modifications will adversely affect their respective development efforts.
Third, a file-based version control system does not provide functional version tracking for a set of related changes that are made by a software developer to certain sections of several source code files in order to implement a functional change or modification into the overall software system.
Fourth, a version control system which saves only the changes made to each source code file does not provide quick and transparent access to a specific version of a software file because it must first implement a source code file rebuild process which sequentially applies each interim version of saved modifications of the source code file to the original master copy of the source code file, thereby creating the requested specific version of the source code file.
The present invention addresses the foregoing problems by providing a software source code version control system for use during the development and maintenance of a software system by multiple software developers in which historical version tracking is maintained for all source code on a line-by-line basis without requiring excessive storage area, in which source code can be accessed and modified by more than one software developer at a time, in which historical version tracking of broad functional changes is provided, and in which quick and transparent access is provided to each version of the source code.
Specifically, a first embodiment of the present invention is directed to a method for version control of source code arranged into a plurality of source code lines. The plurality of source code lines are maintained within a computer device having a memory. The computer device is accessible to a plurality of software developers. The method includes accessing, in response to an access request, at least one of the plurality of source code lines, wherein the plurality of source code lines are stored within a source code storage which is located within the memory. The source code storage is arranged to store a plurality of versions of each of the plurality of source code lines. A copy of at least one of the plurality of versions of the accessed source code lines is generated in response to the access request, and at least one edited source code line is received. The method further includes storing, in the source code storage, a new version of source code line corresponding to each of the edited source code lines received.
Preferably, each version of each source code line is stored in a particular memory location of the source code storage. Version control is maintained by storing an initial version of each source code line and by creating a new version of a particular source code line every time the particular source code line is accessed and edited by a software developer. Specifically, each new version of a particular source code line has a corresponding pointer which points to the memory location of the previous version of the particular source code line from which the new version of the source code line was created. A linked pointer structure is thereby provided in the source code storage which continues to grow as the source code lines are continuously accessed and edited by the software developers. In this manner, the linked pointer structure provides historical version tracking of each of the source code lines.
In another aspect of the present embodiment, each version of each source code line has a corresponding version code, which is stored in the source code storage, that identifies the version of the source code line. Preferably, the version code identifies the version of the source code line to which the version corresponds as a successor version of a previous version of the same source code line or as an initial version of the source code line.
In another aspect, each version of each source code line has a corresponding user code, which is stored in the source code storage, that contains information describing at least one of the software developers. Preferably, the user code identifies those software developers that are allowed to access and edit the version of the source code line to which the user code corresponds. In the case that a new version of a source code line is created corresponding to a source code line that has been accessed and edited by a software developer, the information contained in the user code corresponding to the new version preferably describes the software developer that accessed and edited the source code line.
In a further aspect of the present embodiment, each version of each source code line is stored in the source code storage in a compressed, canonical and format independent form in order to reduce storage requirements for the source code storage. The source code lines are then subsequently expanded to an uncompressed and non-canonical form when they are accessed from the source code storage for editing by the software developers.
According to a further aspect, a plurality of virtual files are stored within the source code storage, wherein each virtual file contains a plurality of line references and each line reference corresponds to one of the plurality of source code lines. The source code storage is arranged to store a plurality of versions of each of the plurality of virtual files. Preferably, a requesting software developer can be sent a copy of a version of each source code line that corresponds to each line reference that is contained in a particular virtual file.
In yet another aspect of the present embodiment, when a software developer has completed and saved a set of modified source code lines and/or newly created source code lines, the software developer can request integration of those versions of source code lines that are saved in the source code storage. The integration of the versions of source code lines creates integrated, official versions of the source code lines for access by all software developers. The user code for each version of source code line that is selected for integration is modified to allow access by all software developers. In addition, the version code for each version of source code line that is selected for integration is also modified to indicate that the version is now an integrated, official version. Preferably, integration of a specific version of a source code line is not performed if more than one software developer has modified and saved a version of that same source code line since either the previous integrated version of the source code line or the initial version of the source code line, whichever is most recent. In such a situation, the software developers are notified of the situation so that they can resolve any differences between their respective modified versions of the same source code lines.
Another embodiment of the present invention provides for a method for editing source- code which is arranged into a plurality of source code lines which are stored in a source code storage. The source code storage is arranged to store a plurality of versions of each of the plurality of source code lines, and is accessible to a plurality of software developers. The method includes sending an access request to the source code storage. The access request contains a reference to at least one of the plurality of source code lines stored in the source code storage. A copy of at least one of the plurality of versions of each source code line referenced in the access request is received from the source code storage, in response to the access request. Each copied version is received in an uncompressed, non-canonical format. At least one of the copied versions of source code lines received from the source code storage is modified, thereby creating at least one edited source code line, and the at least one edited source code lines is sent to the source code storage.
In another aspect of this embodiment, the software developer receives the most recently integrated official version, or the initial version if no subsequent integrated version exists, of each requested source code line from the source code storage. In the alternative, the software developer may receive the most recent version of each requested source code line that was previously modified and saved by the requesting software developer.
According to another embodiment, a special editor is provided so that the software developer may send an access request containing a reference to a virtual file which contains references to source code lines. The software developer then transparently receives a copy of a version of each source code line that is referenced in the virtual file. Preferably, the version of each source code line which is copied and provided to the software developer is the most recently saved version that was modified by the requesting software programmer, or, if no such version exists, the most recently integrated version, or, if no such version exists, the initial version, in that respective order. It can therefore be appreciated that a second software developer may transparently receive a different set of copied source code line versions when using a copy request which references the same virtual file because the second software developer could be provided with the most recent version of the source code lines that were modified by the second software developer, instead of the version of the source code lines that were modified by the first software developer. Thus, multiple software developers can concurrently access and modify the same source code lines referenced in a virtual file, thereby preventing substantial delays during development that are otherwise encountered by a file-based lock-out mechanism that is utilized in traditional file-based version control systems.
In yet another aspect, the special editor allows a requesting software developer to view any version of any source code line, including prior versions that reflect modifications made either by the requesting software developer or by another software developer. In this manner, each of the software developers can see what the other software developers are currently doing in order to coordinate their development efforts and to ensure that modifications made by one particular software developer will not adversely impact the development efforts of other software developers. The special editor can also allow a software developer to access, modify, save and integrate versions of virtual files, virtual objects, and symbol tables in a manner similar to that described above regarding source code lines.
The version control system of the present invention therefore creates new versions for only those source code lines that have been modified or newly created, thereby saving memory space in comparison to traditional file-based version control systems in which a new version of an entire file is saved whenever there is a change to source code within the source code file, no matter how small the change. Furthermore, the version control system of the present invention allows software developers to work together in a coordinated fashion to access, modify and integrate, in a controlled fashion, the versions of source code lines that are stored in the source code storage. It should be noted that the version control system of the present invention is not limited to use in the development, maintenance and control of software source code, but also can be used for version control of other line-based computer data, such as text-based data in a large-scale, multi-author, distributed development environment like a newspaper publishing system, or other similar development environment.